package club.mzywucai.blog.file_system.mapper;

import club.mzywucai.blog.file_system.pojo.po.UserPo;
import org.apache.ibatis.annotations.Param;

/**
 * @author mzywucai
 * @Description
 * @date 2019/2/9
 */
public interface LoginAndRegisterMapper {
    /**
     * @Description 新增用户
     * @author mzywucai
     * @time 2019-02-09
     * @see 
     * @return   int
     * @params  []
     */
    void addUser(@Param("email") String email,
                @Param("password") String password, @Param("activation_uuid") String activationUUID);

    /**
     * @Description 根据email查询用户对象
     * @author mzywucai
     * @time 2019-02-09
     * @see 
     * @return   club.mzywucai.blog.file_system.pojo.po.UserPo
     * @params  [email]
     */
    UserPo searchUserByEmail(@Param("email") String email);

    /**
     * @Description 根据userId查询用户对象
     * @author mzywucai
     * @time 2019-02-09
     * @see 
     * @return   club.mzywucai.blog.file_system.pojo.po.UserPo
     * @params  [userId]
     */
    UserPo searchUserById(@Param("user_id") Long userId);
    
    /**
     * @Description 根据UUID查用户
     * @author mzywucai
     * @time 2019-02-09
     * @see 
     * @return   club.mzywucai.blog.file_system.pojo.po.UserPo
     * @params  [activationUUID]
     */
    UserPo searchUserByUuid(@Param("activation_uuid") String activationUUID);

    /**
     * @Description 根据UUID激活用户
     * @author mzywucai
     * @time 2019-02-09
     * @see 
     * @return   void
     * @params  [activationUUID, yes]
     */
    void updateUserActiveStatus(@Param("activation_uuid") String activationUUID, @Param("is_activation") int yes, @Param("user_name")String username);

    /**
     * @Description 修改用户个人的站点静默状态。
     * @author mzywucai
     * @time 2019-02-15
     * @see 
     * @return   void
     * @params  [silentStatus]
     */
    void updateUserPersonalSilentStatus(@Param("is_silent") int silentStatus, @Param("user_id") long userId);
}
